package com.fengye.validation.config;

import com.fengye.validation.entity.Message;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface MessageRepository extends JpaRepository<Message, Long> {

    @Query("SELECT m.message FROM validation_messages m WHERE m.code = :code AND m.locale = :locale")
    String getMessage(@Param("code") String code, @Param("locale") String locale);
}
